//
//  FKOrderDetailRemarkCell.m
//  WanTao
//
//  Created by Macbook Pro on 2019/4/12.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKOrderDetailRemarkCell.h"
#import "FKOrder.h"

@interface FKOrderDetailRemarkCell ()

@property (nonatomic, weak) UILabel *remarkLabel;

@end

@implementation FKOrderDetailRemarkCell

- (void)setupSubviews
{
    [super setupSubviews];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, fkScreenW, 0.8)];
    [self.contentView addSubview:line];
    line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    UIImageView *iconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"my_order_icon_liuyan"]];
    [self.contentView addSubview:iconView];
    
    UILabel *titleLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 text:@"买家留言"];
    [self.contentView addSubview:titleLabel];
    
    UILabel *remarkLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333];
    [self.contentView addSubview:remarkLabel];
    self.remarkLabel = remarkLabel;
    
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(12);
        make.centerY.offset(0);
        make.width.offset(16);
        make.height.offset(15);
    }];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(iconView.mas_right).offset(8);
        make.top.offset(fk_adjustW(15));
    }];
    [remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(titleLabel);
        make.right.offset(-12);
        make.bottom.offset(fk_adjustW(-15));
    }];
}

- (void)setData:(id)data
{
    [super setData:data];
    
    if ([data isKindOfClass:[FKOrder class]]) {
        FKOrder *model = data;
        self.remarkLabel.text = model.remark ? : @"暂无留言";
    }
}

@end
